package win.smartown.app.weather.entity.forecast;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by smartown on 2017/5/9 14:10.
 * Desc:
 */
public class Daily {

    private String status;
    private List<ColdRisk> coldRisk;
    private List<Temperature> temperature;
    private List<Skycon> skycon;
    private List<Cloudrate> cloudrate;
    private List<Aqi> aqi;
    private List<Humidity> humidity;
    private List<Astro> astro;
    private List<Ultraviolet> ultraviolet;
    private List<PM25> pm25;
    private List<Dressing> dressing;
    private List<CarWashing> carWashing;
    private List<Precipitation> precipitation;
    private List<Wind> wind;

    public List<Temperature> getTemperature() {
        return temperature;
    }

    public List<Skycon> getSkycon() {
        return skycon;
    }

    public static class ColdRisk {

        private int index;
        private String desc;
        private String datetime;

        public int getIndex() {
            return index;
        }

        public String getDesc() {
            return desc;
        }

        public String getDatetime() {
            return datetime;
        }
    }

    public static class Temperature {

        private String date;
        private double max;
        private double avg;
        private double min;

        public String getDate() {
            return date;
        }

        public double getMax() {
            return max;
        }

        public double getAvg() {
            return avg;
        }

        public double getMin() {
            return min;
        }
    }

    public final static class Skycon {

        private String date;
        private String value;

        public String getDate() {
            return date;
        }

        public String getValue() {
            return value;
        }
    }

    public final static class Cloudrate extends Temperature {

    }

    public final static class Aqi extends Temperature {

    }

    public final static class Humidity extends Temperature {

    }

    public final static class Astro {

        private String date;
        private Sunset sunset;
        private Sunrise sunrise;

        public final static class Sunset {
            private String time;

            public String getTime() {
                return time;
            }
        }

        public final static class Sunrise {
            private String time;

            public String getTime() {
                return time;
            }
        }

    }

    public final static class Ultraviolet extends ColdRisk {

    }

    public final static class PM25 extends Temperature {

    }

    public final static class Dressing extends ColdRisk {

    }

    public final static class CarWashing extends ColdRisk {

    }

    public final static class Precipitation extends Temperature {

    }

    public final static class Wind {

        private String date;
        private Value max;
        private Value avg;
        private Value min;

        public String getDate() {
            return date;
        }

        public Value getMax() {
            return max;
        }

        public Value getAvg() {
            return avg;
        }

        public Value getMin() {
            return min;
        }

        public final static class Value {

            private double direction;
            private double speed;

            public double getDirection() {
                return direction;
            }

            public double getSpeed() {
                return speed;
            }
        }

    }

    public List<DailyInfo> getDailyInfo() {
        final List<DailyInfo> list = new ArrayList<>();
        final int size = coldRisk.size();
        for (int i = 0; i < size; i++) {
            DailyInfo dailyInfo = new DailyInfo();
            dailyInfo.setAqi(aqi.get(i));
            dailyInfo.setAstro(astro.get(i));
            dailyInfo.setCarWashing(carWashing.get(i));
            dailyInfo.setCloudrate(cloudrate.get(i));
            dailyInfo.setColdRisk(coldRisk.get(i));
            dailyInfo.setDressing(dressing.get(i));
            dailyInfo.setHumidity(humidity.get(i));
            dailyInfo.setPm25(pm25.get(i));
            dailyInfo.setPrecipitation(precipitation.get(i));
            dailyInfo.setSkycon(skycon.get(i));
            dailyInfo.setTemperature(temperature.get(i));
            dailyInfo.setUltraviolet(ultraviolet.get(i));
            dailyInfo.setWind(wind.get(i));
            list.add(dailyInfo);
        }
        return list;
    }

    public final static class DailyInfo {

        private ColdRisk coldRisk;
        private Temperature temperature;
        private Skycon skycon;
        private Cloudrate cloudrate;
        private Aqi aqi;
        private Humidity humidity;
        private Astro astro;
        private Ultraviolet ultraviolet;
        private PM25 pm25;
        private Dressing dressing;
        private CarWashing carWashing;
        private Precipitation precipitation;
        private Wind Wind;

        public void setColdRisk(ColdRisk coldRisk) {
            this.coldRisk = coldRisk;
        }

        public void setTemperature(Temperature temperature) {
            this.temperature = temperature;
        }

        public void setSkycon(Skycon skycon) {
            this.skycon = skycon;
        }

        public void setCloudrate(Cloudrate cloudrate) {
            this.cloudrate = cloudrate;
        }

        public void setAqi(Aqi aqi) {
            this.aqi = aqi;
        }

        public void setHumidity(Humidity humidity) {
            this.humidity = humidity;
        }

        public void setAstro(Astro astro) {
            this.astro = astro;
        }

        public void setUltraviolet(Ultraviolet ultraviolet) {
            this.ultraviolet = ultraviolet;
        }

        public void setPm25(PM25 pm25) {
            this.pm25 = pm25;
        }

        public void setDressing(Dressing dressing) {
            this.dressing = dressing;
        }

        public void setCarWashing(CarWashing carWashing) {
            this.carWashing = carWashing;
        }

        public void setPrecipitation(Precipitation precipitation) {
            this.precipitation = precipitation;
        }

        public void setWind(Daily.Wind wind) {
            Wind = wind;
        }

        public ColdRisk getColdRisk() {
            return coldRisk;
        }

        public Temperature getTemperature() {
            return temperature;
        }

        public Skycon getSkycon() {
            return skycon;
        }

        public Cloudrate getCloudrate() {
            return cloudrate;
        }

        public Aqi getAqi() {
            return aqi;
        }

        public Humidity getHumidity() {
            return humidity;
        }

        public Astro getAstro() {
            return astro;
        }

        public Ultraviolet getUltraviolet() {
            return ultraviolet;
        }

        public PM25 getPm25() {
            return pm25;
        }

        public Dressing getDressing() {
            return dressing;
        }

        public CarWashing getCarWashing() {
            return carWashing;
        }

        public Precipitation getPrecipitation() {
            return precipitation;
        }

        public Daily.Wind getWind() {
            return Wind;
        }
    }


}
